Left Termination of the query pattern p_in_1(g) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

p(cons(X, nil)).
p(cons(s(s(X)), cons(Y, Xs))) :- ','(p(cons(X, cons(Y, Xs))), ','(mult(X, Y, Z), p(cons(Z, Xs)))).
p(cons(0, Xs)) :- p(Xs).
sum(X, 0, X).
sum(X, s(Y), s(Z)) :- sum(X, Y, Z).
mult(X, 0, 0).
mult(X, s(Y), Z) :- ','(mult(X, Y, W), sum(W, X, Z)).

Queries:

p(g).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(Xs, p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out(cons(X, nil))
U1(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U2(X, Y, Xs, mult_in(X, Y, Z))
mult_in(X, s(Y), Z) → U6(X, Y, Z, mult_in(X, Y, W))
mult_in(X, 0, 0) → mult_out(X, 0, 0)
U6(X, Y, Z, mult_out(X, Y, W)) → U7(X, Y, Z, sum_in(W, X, Z))
sum_in(X, s(Y), s(Z)) → U5(X, Y, Z, sum_in(X, Y, Z))
sum_in(X, 0, X) → sum_out(X, 0, X)
U5(X, Y, Z, sum_out(X, Y, Z)) → sum_out(X, s(Y), s(Z))
U7(X, Y, Z, sum_out(W, X, Z)) → mult_out(X, s(Y), Z)
U2(X, Y, Xs, mult_out(X, Y, Z)) → U3(X, Y, Xs, p_in(cons(Z, Xs)))
U3(X, Y, Xs, p_out(cons(Z, Xs))) → p_out(cons(s(s(X)), cons(Y, Xs)))
U4(Xs, p_out(Xs)) → p_out(cons(0, Xs))

The argument filtering Pi contains the following mapping:
p_in(x1)  =  p_in(x1)
cons(x1, x2)  =  cons(x1, x2)
0  =  0
U4(x1, x2)  =  U4(x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x1, x2, x3, x4)
nil  =  nil
p_out(x1)  =  p_out
U2(x1, x2, x3, x4)  =  U2(x3, x4)
mult_in(x1, x2, x3)  =  mult_in(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
mult_out(x1, x2, x3)  =  mult_out(x3)
U7(x1, x2, x3, x4)  =  U7(x4)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
sum_out(x1, x2, x3)  =  sum_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(Xs, p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out(cons(X, nil))
U1(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U2(X, Y, Xs, mult_in(X, Y, Z))
mult_in(X, s(Y), Z) → U6(X, Y, Z, mult_in(X, Y, W))
mult_in(X, 0, 0) → mult_out(X, 0, 0)
U6(X, Y, Z, mult_out(X, Y, W)) → U7(X, Y, Z, sum_in(W, X, Z))
sum_in(X, s(Y), s(Z)) → U5(X, Y, Z, sum_in(X, Y, Z))
sum_in(X, 0, X) → sum_out(X, 0, X)
U5(X, Y, Z, sum_out(X, Y, Z)) → sum_out(X, s(Y), s(Z))
U7(X, Y, Z, sum_out(W, X, Z)) → mult_out(X, s(Y), Z)
U2(X, Y, Xs, mult_out(X, Y, Z)) → U3(X, Y, Xs, p_in(cons(Z, Xs)))
U3(X, Y, Xs, p_out(cons(Z, Xs))) → p_out(cons(s(s(X)), cons(Y, Xs)))
U4(Xs, p_out(Xs)) → p_out(cons(0, Xs))

The argument filtering Pi contains the following mapping:
p_in(x1)  =  p_in(x1)
cons(x1, x2)  =  cons(x1, x2)
0  =  0
U4(x1, x2)  =  U4(x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x1, x2, x3, x4)
nil  =  nil
p_out(x1)  =  p_out
U2(x1, x2, x3, x4)  =  U2(x3, x4)
mult_in(x1, x2, x3)  =  mult_in(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
mult_out(x1, x2, x3)  =  mult_out(x3)
U7(x1, x2, x3, x4)  =  U7(x4)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
sum_out(x1, x2, x3)  =  sum_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

P_IN(cons(0, Xs)) → U41(Xs, p_in(Xs))
P_IN(cons(0, Xs)) → P_IN(Xs)
P_IN(cons(s(s(X)), cons(Y, Xs))) → U11(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))
U11(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U21(X, Y, Xs, mult_in(X, Y, Z))
U11(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → MULT_IN(X, Y, Z)
MULT_IN(X, s(Y), Z) → U61(X, Y, Z, mult_in(X, Y, W))
MULT_IN(X, s(Y), Z) → MULT_IN(X, Y, W)
U61(X, Y, Z, mult_out(X, Y, W)) → U71(X, Y, Z, sum_in(W, X, Z))
U61(X, Y, Z, mult_out(X, Y, W)) → SUM_IN(W, X, Z)
SUM_IN(X, s(Y), s(Z)) → U51(X, Y, Z, sum_in(X, Y, Z))
SUM_IN(X, s(Y), s(Z)) → SUM_IN(X, Y, Z)
U21(X, Y, Xs, mult_out(X, Y, Z)) → U31(X, Y, Xs, p_in(cons(Z, Xs)))
U21(X, Y, Xs, mult_out(X, Y, Z)) → P_IN(cons(Z, Xs))

The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(Xs, p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out(cons(X, nil))
U1(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U2(X, Y, Xs, mult_in(X, Y, Z))
mult_in(X, s(Y), Z) → U6(X, Y, Z, mult_in(X, Y, W))
mult_in(X, 0, 0) → mult_out(X, 0, 0)
U6(X, Y, Z, mult_out(X, Y, W)) → U7(X, Y, Z, sum_in(W, X, Z))
sum_in(X, s(Y), s(Z)) → U5(X, Y, Z, sum_in(X, Y, Z))
sum_in(X, 0, X) → sum_out(X, 0, X)
U5(X, Y, Z, sum_out(X, Y, Z)) → sum_out(X, s(Y), s(Z))
U7(X, Y, Z, sum_out(W, X, Z)) → mult_out(X, s(Y), Z)
U2(X, Y, Xs, mult_out(X, Y, Z)) → U3(X, Y, Xs, p_in(cons(Z, Xs)))
U3(X, Y, Xs, p_out(cons(Z, Xs))) → p_out(cons(s(s(X)), cons(Y, Xs)))
U4(Xs, p_out(Xs)) → p_out(cons(0, Xs))

The argument filtering Pi contains the following mapping:
p_in(x1)  =  p_in(x1)
cons(x1, x2)  =  cons(x1, x2)
0  =  0
U4(x1, x2)  =  U4(x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x1, x2, x3, x4)
nil  =  nil
p_out(x1)  =  p_out
U2(x1, x2, x3, x4)  =  U2(x3, x4)
mult_in(x1, x2, x3)  =  mult_in(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
mult_out(x1, x2, x3)  =  mult_out(x3)
U7(x1, x2, x3, x4)  =  U7(x4)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
sum_out(x1, x2, x3)  =  sum_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
P_IN(x1)  =  P_IN(x1)
U51(x1, x2, x3, x4)  =  U51(x4)
U31(x1, x2, x3, x4)  =  U31(x4)
SUM_IN(x1, x2, x3)  =  SUM_IN(x1, x2)
U41(x1, x2)  =  U41(x2)
MULT_IN(x1, x2, x3)  =  MULT_IN(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x3, x4)
U71(x1, x2, x3, x4)  =  U71(x4)
U61(x1, x2, x3, x4)  =  U61(x1, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x2, x3, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

P_IN(cons(0, Xs)) → U41(Xs, p_in(Xs))
P_IN(cons(0, Xs)) → P_IN(Xs)
P_IN(cons(s(s(X)), cons(Y, Xs))) → U11(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))
U11(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U21(X, Y, Xs, mult_in(X, Y, Z))
U11(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → MULT_IN(X, Y, Z)
MULT_IN(X, s(Y), Z) → U61(X, Y, Z, mult_in(X, Y, W))
MULT_IN(X, s(Y), Z) → MULT_IN(X, Y, W)
U61(X, Y, Z, mult_out(X, Y, W)) → U71(X, Y, Z, sum_in(W, X, Z))
U61(X, Y, Z, mult_out(X, Y, W)) → SUM_IN(W, X, Z)
SUM_IN(X, s(Y), s(Z)) → U51(X, Y, Z, sum_in(X, Y, Z))
SUM_IN(X, s(Y), s(Z)) → SUM_IN(X, Y, Z)
U21(X, Y, Xs, mult_out(X, Y, Z)) → U31(X, Y, Xs, p_in(cons(Z, Xs)))
U21(X, Y, Xs, mult_out(X, Y, Z)) → P_IN(cons(Z, Xs))

The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(Xs, p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out(cons(X, nil))
U1(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U2(X, Y, Xs, mult_in(X, Y, Z))
mult_in(X, s(Y), Z) → U6(X, Y, Z, mult_in(X, Y, W))
mult_in(X, 0, 0) → mult_out(X, 0, 0)
U6(X, Y, Z, mult_out(X, Y, W)) → U7(X, Y, Z, sum_in(W, X, Z))
sum_in(X, s(Y), s(Z)) → U5(X, Y, Z, sum_in(X, Y, Z))
sum_in(X, 0, X) → sum_out(X, 0, X)
U5(X, Y, Z, sum_out(X, Y, Z)) → sum_out(X, s(Y), s(Z))
U7(X, Y, Z, sum_out(W, X, Z)) → mult_out(X, s(Y), Z)
U2(X, Y, Xs, mult_out(X, Y, Z)) → U3(X, Y, Xs, p_in(cons(Z, Xs)))
U3(X, Y, Xs, p_out(cons(Z, Xs))) → p_out(cons(s(s(X)), cons(Y, Xs)))
U4(Xs, p_out(Xs)) → p_out(cons(0, Xs))

The argument filtering Pi contains the following mapping:
p_in(x1)  =  p_in(x1)
cons(x1, x2)  =  cons(x1, x2)
0  =  0
U4(x1, x2)  =  U4(x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x1, x2, x3, x4)
nil  =  nil
p_out(x1)  =  p_out
U2(x1, x2, x3, x4)  =  U2(x3, x4)
mult_in(x1, x2, x3)  =  mult_in(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
mult_out(x1, x2, x3)  =  mult_out(x3)
U7(x1, x2, x3, x4)  =  U7(x4)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
sum_out(x1, x2, x3)  =  sum_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
P_IN(x1)  =  P_IN(x1)
U51(x1, x2, x3, x4)  =  U51(x4)
U31(x1, x2, x3, x4)  =  U31(x4)
SUM_IN(x1, x2, x3)  =  SUM_IN(x1, x2)
U41(x1, x2)  =  U41(x2)
MULT_IN(x1, x2, x3)  =  MULT_IN(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x3, x4)
U71(x1, x2, x3, x4)  =  U71(x4)
U61(x1, x2, x3, x4)  =  U61(x1, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x2, x3, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 7 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUM_IN(X, s(Y), s(Z)) → SUM_IN(X, Y, Z)

The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(Xs, p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out(cons(X, nil))
U1(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U2(X, Y, Xs, mult_in(X, Y, Z))
mult_in(X, s(Y), Z) → U6(X, Y, Z, mult_in(X, Y, W))
mult_in(X, 0, 0) → mult_out(X, 0, 0)
U6(X, Y, Z, mult_out(X, Y, W)) → U7(X, Y, Z, sum_in(W, X, Z))
sum_in(X, s(Y), s(Z)) → U5(X, Y, Z, sum_in(X, Y, Z))
sum_in(X, 0, X) → sum_out(X, 0, X)
U5(X, Y, Z, sum_out(X, Y, Z)) → sum_out(X, s(Y), s(Z))
U7(X, Y, Z, sum_out(W, X, Z)) → mult_out(X, s(Y), Z)
U2(X, Y, Xs, mult_out(X, Y, Z)) → U3(X, Y, Xs, p_in(cons(Z, Xs)))
U3(X, Y, Xs, p_out(cons(Z, Xs))) → p_out(cons(s(s(X)), cons(Y, Xs)))
U4(Xs, p_out(Xs)) → p_out(cons(0, Xs))

The argument filtering Pi contains the following mapping:
p_in(x1)  =  p_in(x1)
cons(x1, x2)  =  cons(x1, x2)
0  =  0
U4(x1, x2)  =  U4(x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x1, x2, x3, x4)
nil  =  nil
p_out(x1)  =  p_out
U2(x1, x2, x3, x4)  =  U2(x3, x4)
mult_in(x1, x2, x3)  =  mult_in(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
mult_out(x1, x2, x3)  =  mult_out(x3)
U7(x1, x2, x3, x4)  =  U7(x4)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
sum_out(x1, x2, x3)  =  sum_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
SUM_IN(x1, x2, x3)  =  SUM_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUM_IN(X, s(Y), s(Z)) → SUM_IN(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
SUM_IN(x1, x2, x3)  =  SUM_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SUM_IN(X, s(Y)) → SUM_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

MULT_IN(X, s(Y), Z) → MULT_IN(X, Y, W)

The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(Xs, p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out(cons(X, nil))
U1(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U2(X, Y, Xs, mult_in(X, Y, Z))
mult_in(X, s(Y), Z) → U6(X, Y, Z, mult_in(X, Y, W))
mult_in(X, 0, 0) → mult_out(X, 0, 0)
U6(X, Y, Z, mult_out(X, Y, W)) → U7(X, Y, Z, sum_in(W, X, Z))
sum_in(X, s(Y), s(Z)) → U5(X, Y, Z, sum_in(X, Y, Z))
sum_in(X, 0, X) → sum_out(X, 0, X)
U5(X, Y, Z, sum_out(X, Y, Z)) → sum_out(X, s(Y), s(Z))
U7(X, Y, Z, sum_out(W, X, Z)) → mult_out(X, s(Y), Z)
U2(X, Y, Xs, mult_out(X, Y, Z)) → U3(X, Y, Xs, p_in(cons(Z, Xs)))
U3(X, Y, Xs, p_out(cons(Z, Xs))) → p_out(cons(s(s(X)), cons(Y, Xs)))
U4(Xs, p_out(Xs)) → p_out(cons(0, Xs))

The argument filtering Pi contains the following mapping:
p_in(x1)  =  p_in(x1)
cons(x1, x2)  =  cons(x1, x2)
0  =  0
U4(x1, x2)  =  U4(x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x1, x2, x3, x4)
nil  =  nil
p_out(x1)  =  p_out
U2(x1, x2, x3, x4)  =  U2(x3, x4)
mult_in(x1, x2, x3)  =  mult_in(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
mult_out(x1, x2, x3)  =  mult_out(x3)
U7(x1, x2, x3, x4)  =  U7(x4)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
sum_out(x1, x2, x3)  =  sum_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
MULT_IN(x1, x2, x3)  =  MULT_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

MULT_IN(X, s(Y), Z) → MULT_IN(X, Y, W)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
MULT_IN(x1, x2, x3)  =  MULT_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

MULT_IN(X, s(Y)) → MULT_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

P_IN(cons(0, Xs)) → P_IN(Xs)
P_IN(cons(s(s(X)), cons(Y, Xs))) → U11(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
U21(X, Y, Xs, mult_out(X, Y, Z)) → P_IN(cons(Z, Xs))
U11(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U21(X, Y, Xs, mult_in(X, Y, Z))
P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))

The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(Xs, p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out(cons(X, nil))
U1(X, Y, Xs, p_out(cons(X, cons(Y, Xs)))) → U2(X, Y, Xs, mult_in(X, Y, Z))
mult_in(X, s(Y), Z) → U6(X, Y, Z, mult_in(X, Y, W))
mult_in(X, 0, 0) → mult_out(X, 0, 0)
U6(X, Y, Z, mult_out(X, Y, W)) → U7(X, Y, Z, sum_in(W, X, Z))
sum_in(X, s(Y), s(Z)) → U5(X, Y, Z, sum_in(X, Y, Z))
sum_in(X, 0, X) → sum_out(X, 0, X)
U5(X, Y, Z, sum_out(X, Y, Z)) → sum_out(X, s(Y), s(Z))
U7(X, Y, Z, sum_out(W, X, Z)) → mult_out(X, s(Y), Z)
U2(X, Y, Xs, mult_out(X, Y, Z)) → U3(X, Y, Xs, p_in(cons(Z, Xs)))
U3(X, Y, Xs, p_out(cons(Z, Xs))) → p_out(cons(s(s(X)), cons(Y, Xs)))
U4(Xs, p_out(Xs)) → p_out(cons(0, Xs))

The argument filtering Pi contains the following mapping:
p_in(x1)  =  p_in(x1)
cons(x1, x2)  =  cons(x1, x2)
0  =  0
U4(x1, x2)  =  U4(x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x1, x2, x3, x4)
nil  =  nil
p_out(x1)  =  p_out
U2(x1, x2, x3, x4)  =  U2(x3, x4)
mult_in(x1, x2, x3)  =  mult_in(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x4)
mult_out(x1, x2, x3)  =  mult_out(x3)
U7(x1, x2, x3, x4)  =  U7(x4)
sum_in(x1, x2, x3)  =  sum_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
sum_out(x1, x2, x3)  =  sum_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
P_IN(x1)  =  P_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x3, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x2, x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

P_IN(cons(0, Xs)) → P_IN(Xs)
P_IN(cons(s(s(X)), cons(Y, Xs))) → U11(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))
U11(X, Y, Xs, p_out) → U21(Xs, mult_in(X, Y))
U21(Xs, mult_out(Z)) → P_IN(cons(Z, Xs))

The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out
U1(X, Y, Xs, p_out) → U2(Xs, mult_in(X, Y))
mult_in(X, s(Y)) → U6(X, mult_in(X, Y))
mult_in(X, 0) → mult_out(0)
U6(X, mult_out(W)) → U7(sum_in(W, X))
sum_in(X, s(Y)) → U5(sum_in(X, Y))
sum_in(X, 0) → sum_out(X)
U5(sum_out(Z)) → sum_out(s(Z))
U7(sum_out(Z)) → mult_out(Z)
U2(Xs, mult_out(Z)) → U3(p_in(cons(Z, Xs)))
U3(p_out) → p_out
U4(p_out) → p_out

The set Q consists of the following terms:

p_in(x0)
U1(x0, x1, x2, x3)
mult_in(x0, x1)
U6(x0, x1)
sum_in(x0, x1)
U5(x0)
U7(x0)
U2(x0, x1)
U3(x0)
U4(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


P_IN(cons(0, Xs)) → P_IN(Xs)
P_IN(cons(s(s(X)), cons(Y, Xs))) → U11(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
U11(X, Y, Xs, p_out) → U21(Xs, mult_in(X, Y))
The remaining pairs can at least be oriented weakly.

P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))
U21(Xs, mult_out(Z)) → P_IN(cons(Z, Xs))
Used ordering: Combined order from the following AFS and order.
P_IN(x1)  =  x1
cons(x1, x2)  =  cons(x2)
0  =  0
s(x1)  =  s
U11(x1, x2, x3, x4)  =  U11(x3, x4)
p_in(x1)  =  p_in
p_out  =  p_out
U21(x1, x2)  =  U21(x1)
mult_in(x1, x2)  =  mult_in
mult_out(x1)  =  mult_out
nil  =  nil
sum_in(x1, x2)  =  sum_in(x1)
U5(x1)  =  x1
U7(x1)  =  U7
sum_out(x1)  =  sum_out(x1)
U6(x1, x2)  =  x2
U1(x1, x2, x3, x4)  =  x4
U2(x1, x2)  =  x2
U3(x1)  =  U3
U4(x1)  =  x1

Recursive path order with status [2].
Quasi-Precedence:
[cons1, U1^12, pin, pout, U2^11, multin, multout, U7, U3] > sumin1 > 0
[s, sumout1] > sumin1 > 0
nil > 0

Status:
U3: multiset
multin: multiset
U1^12: multiset
0: multiset
s: multiset
nil: multiset
U2^11: multiset
U7: multiset
sumin1: multiset
pin: multiset
cons1: multiset
multout: multiset
pout: multiset
sumout1: [1]


The following usable rules [17] were oriented:

p_in(cons(X, nil)) → p_out
U7(sum_out(Z)) → mult_out(Z)
U6(X, mult_out(W)) → U7(sum_in(W, X))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
U2(Xs, mult_out(Z)) → U3(p_in(cons(Z, Xs)))
p_in(cons(0, Xs)) → U4(p_in(Xs))
mult_in(X, s(Y)) → U6(X, mult_in(X, Y))
mult_in(X, 0) → mult_out(0)
U3(p_out) → p_out
U1(X, Y, Xs, p_out) → U2(Xs, mult_in(X, Y))
U4(p_out) → p_out



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))
U21(Xs, mult_out(Z)) → P_IN(cons(Z, Xs))

The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out
U1(X, Y, Xs, p_out) → U2(Xs, mult_in(X, Y))
mult_in(X, s(Y)) → U6(X, mult_in(X, Y))
mult_in(X, 0) → mult_out(0)
U6(X, mult_out(W)) → U7(sum_in(W, X))
sum_in(X, s(Y)) → U5(sum_in(X, Y))
sum_in(X, 0) → sum_out(X)
U5(sum_out(Z)) → sum_out(s(Z))
U7(sum_out(Z)) → mult_out(Z)
U2(Xs, mult_out(Z)) → U3(p_in(cons(Z, Xs)))
U3(p_out) → p_out
U4(p_out) → p_out

The set Q consists of the following terms:

p_in(x0)
U1(x0, x1, x2, x3)
mult_in(x0, x1)
U6(x0, x1)
sum_in(x0, x1)
U5(x0)
U7(x0)
U2(x0, x1)
U3(x0)
U4(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
QDP
                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))

The TRS R consists of the following rules:

p_in(cons(0, Xs)) → U4(p_in(Xs))
p_in(cons(s(s(X)), cons(Y, Xs))) → U1(X, Y, Xs, p_in(cons(X, cons(Y, Xs))))
p_in(cons(X, nil)) → p_out
U1(X, Y, Xs, p_out) → U2(Xs, mult_in(X, Y))
mult_in(X, s(Y)) → U6(X, mult_in(X, Y))
mult_in(X, 0) → mult_out(0)
U6(X, mult_out(W)) → U7(sum_in(W, X))
sum_in(X, s(Y)) → U5(sum_in(X, Y))
sum_in(X, 0) → sum_out(X)
U5(sum_out(Z)) → sum_out(s(Z))
U7(sum_out(Z)) → mult_out(Z)
U2(Xs, mult_out(Z)) → U3(p_in(cons(Z, Xs)))
U3(p_out) → p_out
U4(p_out) → p_out

The set Q consists of the following terms:

p_in(x0)
U1(x0, x1, x2, x3)
mult_in(x0, x1)
U6(x0, x1)
sum_in(x0, x1)
U5(x0)
U7(x0)
U2(x0, x1)
U3(x0)
U4(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))

R is empty.
The set Q consists of the following terms:

p_in(x0)
U1(x0, x1, x2, x3)
mult_in(x0, x1)
U6(x0, x1)
sum_in(x0, x1)
U5(x0)
U7(x0)
U2(x0, x1)
U3(x0)
U4(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

p_in(x0)
U1(x0, x1, x2, x3)
mult_in(x0, x1)
U6(x0, x1)
sum_in(x0, x1)
U5(x0)
U7(x0)
U2(x0, x1)
U3(x0)
U4(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ UsableRulesReductionPairsProof

Q DP problem:
The TRS P consists of the following rules:

P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the usable rules with reduction pair processor [15] with a polynomial ordering [25], all dependency pairs and the corresponding usable rules [17] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

P_IN(cons(s(s(X)), cons(Y, Xs))) → P_IN(cons(X, cons(Y, Xs)))
No rules are removed from R.

Used ordering: POLO with Polynomial interpretation [25]:

POL(P_IN(x1)) = 2·x1   
POL(cons(x1, x2)) = 2·x1 + x2   
POL(s(x1)) = 2·x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ UsableRulesReductionPairsProof
QDP
                                        ↳ PisEmptyProof

Q DP problem:
P is empty.
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.